
<?php


if(!empty($_POST)){


  // 判断密码输入是否一致
  if($_POST['password']!=$_POST['cpassword']){
     echo"<script>alert('密码不一致');history.go(-1)</script>";die;
  }

  unset($_POST['cpassword']);

  $_POST['password'] = md5($_POST['password']);

  $_rows = add('admin',$_POST);

  if($_rows>0){
     echo"<script>alert('提交成功');location.href='index.php?c=admin&a=list&admin=1';</script>";die;
  }else{
     echo"<script>alert('提交失败');history.go(-1)</script>";die;
  }

}

  // 查询角色名称
  $role = getSelect('role');


//加载后台公共视图
 include (View_PATH.$admin.'/communal.html');


?>

